#include <list>
#include <gtest/gtest.h>

#include "test_func.h"

TEST(IsPrimeTest, HandleTrueReturn)  
{  
    EXPECT_TRUE(IsPrime(3));  
    EXPECT_TRUE(IsPrime(5));  
    EXPECT_TRUE(IsPrime(11));  
    EXPECT_TRUE(IsPrime(23));  
    EXPECT_TRUE(IsPrime(17));  
}

class ParamTest : public ::testing::TestWithParam<int>
{
};

TEST_P(ParamTest,ValueParam)
{
    int n =  GetParam();
    EXPECT_TRUE(IsPrime(n));
}

INSTANTIATE_TEST_SUITE_P(ValueParam,ParamTest, ::testing::Values(3,5,11,23,17));

/*
template <typename T>
class FooTest : public ::testing::Test
{

};


TYPED_TEST_CASE_P(FooTest);

TYPED_TEST(FooTest, DoseBlash) 
{
}

TYPED_TEST_P(FooTest,HasPropertyA)
{

}

REGISTER_TYPED_TEST_CASE_P(FooTest, DoseBlash ,HasPropertyA);
typedef ::testing::Types<char,int,unsigned int> MyTypes;
INSTANTIATE_TYPED_TEST_CASE_P(My,FooTest,MyTypes);
*/

template <typename T>
class FooTest: public ::testing::Test{
public:
    typedef std::list<T> List;
    static T shared_;
    T value_;
};
template <typename T> T FooTest<T>::shared_;

using MyTypes = ::testing::Types<char,int ,unsigned int>;
TYPED_TEST_SUITE(FooTest,MyTypes);
TYPED_TEST(FooTest, DoesBlah) {
  // Inside a test, refer to the special name TypeParam to get the type
  // parameter.  Since we are inside a derived class template, C++ requires
  // us to visit the members of FooTest via 'this'.
  TypeParam n = this->value_;

  // To visit static members of the fixture, add the 'TestFixture::'
  // prefix.
  n += TestFixture::shared_;

  // To refer to typedefs in the fixture, add the 'typename TestFixture::'
  // prefix.  The 'typename' is required to satisfy the compiler.
  typename TestFixture::List values;
  values.push_back(n);  
}

/*
template <class T>
class TmpTestF : public testing::Test{
    protected:
    TmpTestF(){}
    T value_;
};


using mytypes  = testing::Types<>;
TYPED_TEST_SUITE(TmpTestF,mytypes);
TYPED_TEST(TmpTestF,testcase1)
{
    this->value =-1;
    EXPECT_LT(this->value_,0);
}

TYPED_TEST_SUITE_P(TmpTestF)
TYPED_TEST_P(TmpTestF,TypeParam)
{
    this->value_=-1;
    std::cout << " value_ is" << this->value_ << std::endl;
    EXPECT_LT(this->value_,0)
}
REGISTER_TYPED_TEST_SUITE_P(TmpTestF,TypeParam);
INSTANTIATE_TYPED_TEST_SUITE_P(My ,TmpTestF,mytypes);
*/
int main(int argc,char* argv[])
{
    ::testing::InitGoogleTest(&argc,argv);
    return RUN_ALL_TESTS();
}